from langchain_openai import ChatOpenAI
from langchain_core.messages import HumanMessage, SystemMessage

import os


os.environ["OPENAI_API_KEY"] = "sk-FBnGRndpPPUBlTTSgWXhA5bbS1Iy9louFxsez6qSAYT3BlbkFJagaFRuUrZ523p-D-IE4jwvivrdv_sjROHWIR7cnyQA"


llmchat = ChatOpenAI(
    model="gpt-4o-mini",
    organization="org-J5njw7wfzmBob7yaPyS1Tls7",
    api_key="sk-FBnGRndpPPUBlTTSgWXhA5bbS1Iy9louFxsez6qSAYT3BlbkFJagaFRuUrZ523p-D-IE4jwvivrdv_sjROHWIR7cnyQA"
    # other params...
)
print(llmchat([HumanMessage(content="写一首情诗")]).content)
#
# curl https://api.openai.com/v1/models \
#   -H "Authorization: Bearer sk-FBnGRndpPPUBlTTSgWXhA5bbS1Iy9louFxsez6qSAYT3BlbkFJagaFRuUrZ523p-D-IE4jwvivrdv_sjROHWIR7cnyQA" \
#   -H "OpenAI-Organization: org-J5njw7wfzmBob7yaPyS1Tls7" \

# curl https://api.openai.com/v1/chat/completions \
#   -H "Content-Type: application/json" \
#   -H "Authorization: Bearer sk-FBnGRndpPPUBlTTSgWXhA5bbS1Iy9louFxsez6qSAYT3BlbkFJagaFRuUrZ523p-D-IE4jwvivrdv_sjROHWIR7cnyQA" \
#   -d '{
#      "model": "gpt-4o-mini",
#      "messages": [{"role": "user", "content": "Say this is a test!"}],
#      "temperature": 0.7
#    }'